//
//  MineTabCell.m
//  RentTable
//
//  Created by xchuan xchuan on 2024/12/1.
//

#import "MineTabCell.h"

@interface MineTabCell()

@property (nonatomic, strong) UIImageView *itemImageView;
@property (nonatomic, strong) UILabel *itemLabel;

@end

@implementation MineTabCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self == [super initWithFrame:frame]) {
        [self setUI];
    }
    return self;
}

- (void)setTableData:(NSArray *)tabData {
    [self.itemImageView setImage:[UIImage imageNamed:tabData[0]]];
    self.itemLabel.text = tabData[1];
}

- (void)setUI {
    self.itemImageView = [UIImageView new];
    [self addSubview:self.itemImageView];
    [self.itemImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.top.mas_equalTo(13);
        make.size.mas_equalTo(CGSizeMake(32, 32));
    }];
    
    self.itemLabel = [[UILabel alloc] init];
    self.itemLabel.font = [UIFont pingFangSCMediumWithSize:11];
    self.itemLabel.textColor = myRGBHex(0x333333);
    [self addSubview:self.itemLabel];
    
    [self.itemLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.top.equalTo(self.itemImageView.mas_bottom).offset(12);
        make.height.mas_equalTo(15);
    }];
}

@end
